﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="frm_Asignaciones.aspx.cs" Inherits="ED_Nivelacion.PresentacionWeb.Asignaciones" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentCss" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1 {
            width: 194px;
        }

        .auto-style3 {
            width: 200px;
        }

        .auto-style7 {
            width: 192px;
        }

        .auto-style8 {
            width: 161px;
        }

        .auto-style9 {
            width: 382px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <form id="Form1" runat="server">
        <script>
            $(document).on("click", ".borrar", function () {

                var id = $(this).data("id");

                //alert(id);
                $('#ContentPlaceHolder1_idEliminar').val(id);

            });
            $(document).on("click", ".editar", function () {

                var id = $(this).data("idparalelo");
                var nombre = $(this).data("nombre");
                var periodo = $(this).data("periodo");
                var carrera = $(this).data("carrera");


                $('#ContentPlaceHolder1_txt_Editar').val(carrera);
                $('#ContentPlaceHolder1_txt_CCDocente').val(periodo);
                $('#ContentPlaceHolder1_cbm_Paralelo').val(nombre);
                $('#ContentPlaceHolder1_idParalelo').val(id);

                $('#ContentPlaceHolder1_EditarBtn').show();
                $('#ContentPlaceHolder1_btm_Agregar').hide();
            });

            $(document).on("click", ".guardar", function () {
                var id = $(this).data("idcarrera");
                // 

                $('#ContentPlaceHolder1_Btn_Guardar_Coordinador').show();
                $('#ContentPlaceHolder1_btn_Editar_Coordinador').hide();
            });


        </script>
        <% ED_Nivelacion.Negocios.Coordinador_C _objCoordinador_C = new ED_Nivelacion.Negocios.Coordinador_C();
           ED_Nivelacion.Negocios.Tutor_C _objTutor_C = new ED_Nivelacion.Negocios.Tutor_C();
        %>



        <div class="col-lg-22">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            &nbsp;<asp:Timer ID="Timer1" runat="server">
            </asp:Timer>

            <div class="portlet-body">

                <div class="panel-group" id="accordion">

                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">Coordinadores
                                </a>
                            </h4>
                        </div>
                        <div id="collapseOne" class="panel-collapse collapse in">
                            <div class="panel-body">

                                <div class="portlet portlet-default">
                                    <div class="portlet-heading">
                                        <div class="portlet-title">
                                            <h4>TABLA DE COORDINADORES</h4>

                                        </div>
                                        <div class="clearfix">
                                            <div class="portlet-widgets">
                                                <a class="btn btn-success btn-xs" data-toggle="modal" data-target="#AsignarCoordinador"><i class="fa fa-plus">Asignar </i></a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="portlet-body">
                                        <div class="table-responsive">

                                            <table id="Coordinador" class="table table-striped table-bordered table-hover table-green">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th>NOMBRE</th>
                                                        <th>APELLIDO</th>
                                                        <th>CÉDULA O PASAPORTE</th>
                                                        <th>PERIODO</th>
                                                        <th>ACCIÓN</th>
                                                    </tr>
                                                </thead>

                                                <tbody>
                                                    <%
                                                        foreach (var item in _objCoordinador_C.FiltrarCoordinadorActivo())
                                                        {
                                               
                                           
                                                    %>
                                                    <tr class="odd gradeX">
                                                        <td><%=item.idCoordinador %></td>
                                                        <td><%=item.Nombre %></td>
                                                        <td><%=item.Apellido %></td>
                                                        <td><%=item.Cedula %></td>
                                                        <td><%=item.Nombre_Periodo %></td>
                                                        <td class="center"><a href="#" class="btn btn-red btn-sm guardar" data-toggle="confirmation" data-placement="top" data-singleton="true" data-cor="<%=item.idCoordinador %>"><i class="icon-white icon-next fa fa-times" data-target=""></i>QUITAR</a></td>

                                                    </tr>
                                                    <%} %>
                                                </tbody>
                                                <asp:TextBox ID="idEliminar" runat="server" CssClass="hidden"></asp:TextBox>
                                            </table>

                                        </div>
                                        <!-- /.table-responsive -->
                                    </div>
                                    <!-- /.portlet-body -->
                                </div>



                            </div>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">Tutores
                                </a>
                            </h4>
                        </div>
                        <div id="collapseTwo" class="panel-collapse collapse">
                            <div class="panel-body">

                                <div class="portlet portlet-default">
                                    <div class="portlet-heading">
                                        <div class="portlet-title">
                                            <h4>TABLA DE TUTORES</h4>

                                        </div>
                                        <div class="clearfix">
                                            <div class="portlet-widgets">
                                                <a class="btn btn-success btn-xs" data-toggle="modal" data-target="#AsignarTutoria"><i class="fa fa-plus">Asignar </i></a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="portlet-body">
                                        <div class="table-responsive">

                                            <table id="Docente" class="table table-striped table-bordered table-hover table-green">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th>NOMBRE</th>
                                                        <th>APELLIDO</th>
                                                        <th>JORNADA</th>
                                                        <th>PERIODO</th>
                                                        <th>ACCIÓN</th>
                                                    </tr>
                                                </thead>

                                                <tbody>
                                                    <%
                                                        foreach (var item in _objTutor_C.ObtenerTutor())
                                                        {
                                                    %>

                                                    <tr class="odd gradeX">
                                                        <td><%=item.idTutor%></td>
                                                        <td><%=item.Nombre %></td>
                                                        <td><%=item.Apellido %></td>
                                                        <td class="center"><%= item.Jornada%></td>
                                                        <td class="center"><%= item.Nombre_Periodo %></td>
                                                        <td class="center"><a href="#" class="btn btn-red btn-sm asignar" data-toggle="confirmation" data-placement="top" data-singleton="true" data-jor="<%= item.idDistribucion_Jornada %>"><i class="icon-white icon-next fa fa-times" data-target=""></i>QUITAR</a></td>

                                                    </tr>

                                                    <%} %>
                                                </tbody>
                                                <asp:TextBox ID="idEliminarT" runat="server" CssClass="hidden"></asp:TextBox>
                                            </table>

                                        </div>
                                        <!-- /.table-responsive -->
                                    </div>
                                    <!-- /.portlet-body -->
                                </div>



                            </div>
                        </div>
                    </div>
                </div>

            </div>

            <!-- /.portlet -->

        </div>

        <div class="col-lg-22">
            <div class="modal modal-flex fade" id="AsignarCoordinador" tabindex="-1" role="dialog" aria-labelledby="flexModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="flexModalLabel">Asignar Coordinador</h4>
                        </div>
                        <div id="Div1" class="modal-body" runat="server">
                            <div class="panel panel-default">

                                <div class="panel-body">
                                    <div class="table-responsive">


                                        <asp:TextBox ID="txt_Editar" runat="server" CssClass="hidden"></asp:TextBox>

                                        <table class="table table-striped table-bordered table-hover">
                                            <thead>
                                                <tr>
                                                    <th class="auto-style1">Datos</th>
                                                    <th>Coordinador</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td class="auto-style1">Nombre Coordinador:</td>
                                                    <td>
                                                        <asp:DropDownList ID="Cbm_Coordinador" runat="server" AppendDataBoundItems="true" CssClass="form-control" Style="width: 200px;">
                                                            <asp:ListItem Value="">Escoja una opción</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>

                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <asp:Button ID="Btn_Guardar_Coordinador" runat="server" CssClass="btn btn-default btn-sm" Text="GUARDAR" OnClick="Btn_Guardar_Coordinador_Click" />
                            <%--<asp:Button ID="btn_Editar_Coordinador" runat="server" CssClass=" btn btn-primary btn-sm" Text="EDITAR" />--%>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <!-- /.modal -->
        </div>
        <div class="col-lg-12">
            <div class="modal modal-flex fade" id="AsignarTutoria" tabindex="-1" role="dialog" aria-labelledby="flexModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="H1">Asignar Tutoría</h4>
                        </div>
                        <div id="Div3" class="modal-body" runat="server">
                            <div class="panel panel-default">

                                <div class="panel-body">
                                    <div class="table-responsive">




                                        <table class="table table-striped table-bordered table-hover">
                                            <thead>
                                                <asp:TextBox ID="txt_Docente" runat="server" CssClass="hidden"></asp:TextBox>
                                                <tr>
                                                    <th class="auto-style1">Datos</th>
                                                    <th>Docente</th>
                                                </tr>
                                                <tr>
                                                    <td class="auto-style1">Jornada:</td>
                                                    <td>
                                                        <asp:DropDownList ID="cbm_Jornada" runat="server" Enabled="true" AppendDataBoundItems="true">
                                                            <asp:ListItem Value="">Escoja una opción</asp:ListItem>
                                                        </asp:DropDownList></td>
                                                </tr>
                                                <tr>
                                                    <td class="auto-style1">Periodo:</td>
                                                    <td>
                                                        <asp:DropDownList ID="Cbm_Docente" runat="server" Enabled="true" AppendDataBoundItems="true" CssClass="form-control" Style="width: 200px;">
                                                            <asp:ListItem Value="">Escoja una opción</asp:ListItem>
                                                        </asp:DropDownList></td>
                                                </tr>

                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <asp:Button ID="btn_Tutor" runat="server" CssClass="btn btn-default btn-sm" Text="GUARDAR" OnClick="btn_Tutor_Click" />

                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <!-- /.modal -->
        </div>
        <script>
            $('[data-jor]').click(function () {

                var Id = $(this).data('jor');
                $("#ContentPlaceHolder1_idEliminarT").val(Id);
                $("#ContentPlaceHolder1_idEliminar").val("");
                alert(Id);
            });

            $('[data-cor]').click(function () {
                var Id = $(this).data('cor');
                $("#ContentPlaceHolder1_idEliminar").val(Id);
                $("#ContentPlaceHolder1_idEliminarT").val("");
                //alert(Id);
            });
            $('[data-toggle="confirmation"]').confirmation({
                placement: 'top', // How to position the confirmation - top | bottom | left | right
                trigger: 'click', // How confirmation is triggered - click | hover | focus | manual
                title: 'Esta seguro?', // Default title value if `data-title` attribute isn't present  
                template: '<div class="popover" >' +
                    '<div class="arrow"></div>' +
                    '<h3 class="popover-title"></h3>' +
                    '<div class="popover-content text-center">' +
                    '<div id="botones" class="btn-group">' +
                    '<asp:LinkButton ID="BtnEliminar" runat="server" CssClass="btn btn-success btn-xs" OnClick="Delete_Click"><i class="fa fa-check-circle icon-white"></i> Si</asp:LinkButton>' +
                    '<a class="btn btn-xs" data-dismiss="confirmation"></a>' +
                    '</div>' +
                    '</div>'
                , btnOkClass: 'btn-primary'
                , btnOkIcon: 'fa fa-check-circle'
                , btnCancelClass: 'btn-danger'
                , btnOkLabel: 'Si'
                , btnCancelIcon: 'fa fa-times-circle'
                , btnCancelLabel: 'No',
                singleton: true, // Set true to allow only one confirmation to show at a time.
                popout: false, // Set true to hide the confirmation when user clicks outside of it.
                onConfirm: function () {

                }, // Set event when click at confirm button
                onCancel: function () { }
            }); // Set event when click at cancel button

            $(document).ready(function () {
                $("#<%Response.Write(Cbm_Docente.ClientID);%>").searchable(
                             {
                                 maxListSize: 400,                       // if list size are less than maxListSize, show them all
                                 maxMultiMatch: 10,                      // how many matching entries should be displayed
                                 exactMatch: false,                      // Exact matching on search
                                 wildcards: true,                        // Support for wildcard characters (*, ?)
                                 ignoreCase: true,                       // Ignore case sensitivity
                                 latency: 200,                           // how many millis to wait until starting search
                                 warnMultiMatch: 'top {0} matches ...',  // string to append to a list of entries cut short by maxMultiMatch
                                 warnNoMatch: 'No existen coincidencias',          // string to show in the list when no entries match
                                 zIndex: 'auto'                          // zIndex for elements generated by this plugin
                             });

                $("#<%Response.Write(Cbm_Coordinador.ClientID);%>").searchable(
                        {
                            maxListSize: 400,                       // if list size are less than maxListSize, show them all
                            maxMultiMatch: 10,                      // how many matching entries should be displayed
                            exactMatch: false,                      // Exact matching on search
                            wildcards: true,                        // Support for wildcard characters (*, ?)
                            ignoreCase: true,                       // Ignore case sensitivity
                            latency: 200,                           // how many millis to wait until starting search
                            warnMultiMatch: 'top {0} matches ...',  // string to append to a list of entries cut short by maxMultiMatch
                            warnNoMatch: 'No existen coincidencias',          // string to show in the list when no entries match
                            zIndex: 'auto'                          // zIndex for elements generated by this plugin
                        });
            });
            ///version del browser
            jQuery.browser = {};
            (function () {
                jQuery.browser.msie = false;
                jQuery.browser.version = 0;
                if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
                    jQuery.browser.msie = true;
                    jQuery.browser.version = RegExp.$1;
                }
            })();


        </script>

    </form>
</asp:Content>
